module RComp
    module DotNet
        class FscTask < CompilerTask
            def initialize(name=:compile, exe="fsc")
                super(name, exe, false)
            end

            def add_option(name, value=nil)
                case name
                    when :debug
                        opt = ToggleOption.new("g", value, "-")
                    when :import
                        name = value.hash
                        opt = Option.new("I", value, "-", " ")
                    when :out
                        opt = Option.new("o", value, "-", " ")
                    when :reference
                        name = value.hash
                        opt = Option.new("r", value, "-", " ")
                    when :target
                        opt = Option.new(name, value, "--", "-")
                    else
                        opt = Option.new(name, value, "-", " ")
                end

                compiler_options[name] = opt.to_s if opt.add?
                self
            end

            def add_switch(name)
                case name
                    when :nologo
                        return self
                    else
                        opt = Option.new(name, nil, "--")
                end

                compiler_options[name] = opt.to_s
                self
            end
        end
    end
end
